Skip to content

fix: cache breakable fit advances per mode#161

Closed
hiSandog wants to merge 1 commit into
chenglou:mainfrom
hiSandog:fix/breakable-fit-cache-20260430
Closed

fix: cache breakable fit advances per mode#161
hiSandog wants to merge 1 commit into
chenglou:mainfrom
hiSandog:fix/breakable-fit-cache-20260430

Conversation

@hiSandog
Copy link
Copy Markdown
Contributor

Summary

  • cache breakable fit advances separately for each fit mode
  • preserve the long segment-prefix fallback under the pair-context cache slot
  • add a regression test covering repeated calls across sum, pair, and prefix modes

Fixes #137.

Validation

  • npx tsc --noEmit
  • npx oxlint --type-aware src
  • git diff --check

Note: bun is not installed in this environment, so I could not run bun test src/layout.test.ts.

Himaan1998Y pushed a commit to Himaan1998Y/pretext that referenced this pull request May 4, 2026
npm install from github: requires dist/ present — the prepack script
uses rm -rf (POSIX-only) and bun, so GitHub Actions/npm won't rebuild
it reliably. Pre-committing the dist built from our patched source
(PRs chenglou#160, chenglou#161, chenglou#132) ensures consumers get the correct artifact.
@chenglou
Copy link
Copy Markdown
Owner

chenglou commented May 8, 2026

Thanks for the PR! Main already has the correctness fix from 1a8b2ae, and I added the targeted regression coverage in 2adcbc8. I’m going to close this without merging since the multi-mode cache implementation isn’t needed right now.

@chenglou chenglou closed this May 8, 2026
Himaan1998Y pushed a commit to Himaan1998Y/pretext that referenced this pull request May 30, 2026
npm install from github: requires dist/ present — the prepack script
uses rm -rf (POSIX-only) and bun, so GitHub Actions/npm won't rebuild
it reliably. Pre-committing the dist built from our patched source
(PRs chenglou#160, chenglou#161, chenglou#132) ensures consumers get the correct artifact.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getSegmentBreakableFitAdvances: cached result does not distinguish BreakableFitMode

2 participants